/*******************************************************************************
**
** Copyright (c) 2011 - The OWE Team
**
** This file is part of OWE.
**
** OWE is a free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; version
** version 2.1 of the License.
**
** OWE is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with OWE. If not, see <http://www.gnu.org/licenses/>.
**
*******************************************************************************/

#include <owe/node.h>
#include <owe/textelement.h>
#include <owe/ustring.h>

OWE_USE_NAMESPACE

/*!
    \class TextElement
    \brief Holds the text node.

    \ingroup Configuration

    This is not an element itself according to the specification, but is
    implemented as one because of how XML parsers (DOM API) deals with text
    <a href="http://www.w3.org/TR/widgets/#text-node">nodes</a>.
*/

/*!
    \fn UString TextElement::content() const

    Returns the text node contents.
*/

/*!
    Constructs a new TextElement from a given \a node.
*/
TextElement::TextElement(const Node *node)
    : Element(node, Element::Text)
    , m_content(node->data())
{
}

/*!
    Destructs the object releasing all allocated resources.
*/
TextElement::~TextElement()
{
}
